package cc.comac.mom.service.impl.config;

import cc.comac.mom.api.config.EquipLabelConfigService;
import cc.comac.mom.bean.config.EquipLabelConfigParamBean;
import cc.comac.mom.datahandlers.entity.config.EquipLabelConfigDataHandler;
import cc.comac.mom.entity.config.EquipLabelConfigEntity;
import cc.comac.mom.util.ResultBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@Service
@RestController
public class EquipLabelConfigServiceImpl implements EquipLabelConfigService {

	@Autowired
	private EquipLabelConfigDataHandler equipLabelConfigDataHandler;

	@Override
	public ResultBean save(@RequestBody EquipLabelConfigEntity obj) {
		return equipLabelConfigDataHandler.saveLabelConfig(obj);
	}

	@Override
	public ResultBean update(@RequestBody EquipLabelConfigEntity obj) {
		return equipLabelConfigDataHandler.updateLabelConfig(obj);
	}

	@Override
	public ResultBean delete(@RequestBody EquipLabelConfigEntity obj) {

		return equipLabelConfigDataHandler.delete(obj);
	}

	@Override
	public ResultBean getById(@RequestBody EquipLabelConfigEntity obj) {
		ResultBean resultBean = new ResultBean(true);
		resultBean.setObject(equipLabelConfigDataHandler.getById(obj.getId()));
		return resultBean;

	}
	@Override
	public ResultBean selectByCondition(@RequestBody EquipLabelConfigParamBean obj) {
		ResultBean resultBean = new ResultBean(true);
		resultBean.setObject( equipLabelConfigDataHandler.selectBySomeFields(obj));
		return resultBean;
	}

}
